package com.order.mapper;

import com.order.bean.Foods;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface FoodsMapper {

    @Insert("insert into foods (name, descr, price, img)" +
            "values (#{name}, #{descr}, #{price}, #{img})")
    boolean insert(Foods record);

    boolean update(Foods record);

    @Delete("delete from foods where id = #{id}")
    boolean deleteById(Integer id);

    @Select("select * from foods where user_id = #{userId}")
    Foods selectById(Integer id);

    List<Foods> selectAll(Foods foods);

    /*@Update("update foods set user_id = null, free = '是' where id = #{id}")
    void removeOrder(Integer id);*/
}
